package com.dlyk.service.impl;

import com.dlyk.mapper.RolePermissionMapper;
import com.dlyk.model.RolePermission;
import com.dlyk.service.RolePermissionService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class RolePermissionServiceImpl implements RolePermissionService {

    @Resource
    private RolePermissionMapper rolePermissionMapper;

    /**
     * 角色授权
     */
    @Override
    public int addRolePermission(RolePermission rolePermission) {
        return rolePermissionMapper.insertSelective(rolePermission);
    }

    /**
     * 移除权限
     */
    @Override
    public int removeRolePermissionByRoleIdAndPermissionId(Integer roleId, Integer permissionId) {
        return rolePermissionMapper.deleteRolePermissionByRoleIdAndPermissionId(roleId, permissionId);
    }

}

